package ejemplo.util;

import java.awt.Rectangle;

/**
 * Clase que representa una forma circular
 * @author Miguel Vicente
 *
 */
public class FormaCircular implements IForma {
	
	private int centroX;
	private int centroY;
	private int radio;
	
	public FormaCircular(int centroX, int centroY, int radio) {
		this.centroX = centroX;
		this.centroY = centroY;
		this.radio = radio;
	}
	
	@Override
	public Rectangle getBounds() {
		int x = centroX - radio;
		int y = centroY - radio;
		int diametro = radio * 2;
		return new Rectangle(x, y, diametro, diametro);
	}
	
	@Override
	public int getTipoForma() {
		return IForma.CIRCULAR;
	}

	public int getCentroX() {
		return centroX;
	}

	public void setCentroX(int centroX) {
		this.centroX = centroX;
	}

	public int getCentroY() {
		return centroY;
	}

	public void setCentroY(int centroY) {
		this.centroY = centroY;
	}

	public int getRadio() {
		return radio;
	}

	public void setRadio(int radio) {
		this.radio = radio;
	}

}
